﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using RearLivestock.Common.Domains.hq;
using RearLivestock.Common.Dtos;
using RearLivestock.RBAC.Api.Application.hqApplication.Commands.Bedroomss;
using RearLivestock.RBAC.Api.Application.hqApplication.Commands.Eliminate;
using RearLivestock.RBAC.Api.Application.hqApplication.Commands.PigFarmss;

namespace RearLivestock.RBAC.Api.Controllers.hq
{
    /// <summary>
    /// 猪只淘汰
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class EliminatesController : ControllerBase
    {
        private readonly IMediator imediator;

        public EliminatesController(IMediator imediator)
        {
            this.imediator = imediator;
        }


        /// <summary>
        /// 淘汰添加
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> addEliminate(AddEliminateCommand command)
        {
            return await imediator.Send(command);

        }
        /// <summary>
        /// 淘汰显示
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result<PageResultDto<Eliminates>>> showEliminates(ShowEliminatesComand cmd)

        {
            return await imediator.Send(cmd);
        }



    }
}
